import request from '@/utils/request'

const PRODUCT_BASE_URL = '/product'

export function getProducts() {
  return request({
    url: PRODUCT_BASE_URL + '/getAllPro',
    method: 'get'
  })
}

export function updateProduct(productTem) {
  return request({
    url: PRODUCT_BASE_URL + '/updatePro',
    method: 'post',
    data: productTem
  })
}

export function deleteProduct(id) {
  return request({
    url: PRODUCT_BASE_URL + `/deletePro/${id}`,
    method: 'get'
  })
}

export function searchPro(id) {
  return request({
    url: PRODUCT_BASE_URL + `/getPro/${id}`,
    method: 'get'
  })
}

export function addPro(proTem) {
  return request({
    url: PRODUCT_BASE_URL + '/addPro',
    method: 'post',
    data: proTem
  })
}

export function addService(service) {
  return request({
    url: PRODUCT_BASE_URL + '/addAtomic',
    method: 'post',
    data: service
  })
}